import java.util.*;

public class Main
{
    public static void main(String []args)
    {
	try
	{
	    Random rnd = new Random();
	    Scanner in = new Scanner(System.in);
	    int len = in.nextInt();
	    int N = in.nextInt();
	    double Gauss[] = new double [len];
	    double Gauss1[] = new double [len];
	    Arrays.fill(Gauss, -0.5 * N);
	    for (int i = 0; i < len; ++i)
	    {
		for (int j = 0; j < N; ++j)
		    Gauss[i] += rnd.nextDouble();
		Gauss[i] *= Math.sqrt(12.0/ N);
		Gauss1[i] = Gauss[i] - 41.0 / (13440 * N * N) * (Math.pow(Gauss[i], 5) - 10 * Math.pow(Gauss[i],3) + 15 * Gauss[i]);
	    }
	    double e = 0, d = 0;
	    for (double x : Gauss)
		e += x;
	    e /= len;
	    for (double x: Gauss)
		d += Math.pow(e - x, 2.0);
	    d /= (len - 1);
	    double e1 = 0, d1 = 0;
	    for (double x: Gauss1)
		e1 += x;
	    e1 /= len;
	    for (double x: Gauss1)
		d1 += Math.pow(e1 - x, 2.0);
	    d1 /= (len - 1);

	    System.out.println(e + "\t" + e1);
	    System.out.println(d + "\t" + d1);
	}
	catch(Throwable e){System.out.println(e.getMessage());}
    }

}
